﻿<html>
<head>
<script type="text/javascript">
function checkSubmit(){
    if ( confirm("确认提交表单吗？")){
        var your_name = testform.your_name.value;
        if( your_name == "" ){
            alert("请填写您的名字！");
	    testform.your_name.focus(); 
            return false;
        }
        alert("您好" + your_name + "！");
    } else {
        return false;
    }
}
</script>
</head>
<body>
<form name="testform" onsubmit="return checkSubmit();">
<p>
您的名字：<input type="text" name="your_name" />
<input type="submit" value=" 提交 " />
</p>
</form>
</body>
</html>
